<?php
/**
 * Created by PhpStorm.
 * User: longyu
 * Date: 2016/11/8
 * Time: 12:43
 */

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TestController extends Controller
{
    public function SetSession(Request $request){
        $request->session()->put("id",88);
        $result="set the id success";
        return response()->json(['name'=>$result,'passwd'=>'LaravelAcademy.org'])
            ->setCallback(request()->input('callbackparam'));
    }

    public function GetSession(Request $request){
        $id=$request->session()->get("id");
        $result="get the id:".$id;
        //return "callbackparam(".$result.")";
        return response()->json(['name'=>$result,'passwd'=>'LaravelAcademy.org'])
            ->setCallback(request()->input('callbackparam'));
    }

    public function Getinfo(){
        return "hello";
    }
}